<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="cms-taglib" prefix="cms" %>
<%@ taglib uri="cms-util-taglib" prefix="cmsu" %>
<%@ taglib uri="http://www.magnolia.info/tlds/cmsfn-taglib.tld" prefix="cmsfn" %>

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%-- based on http://code.google.com/apis/recaptcha/docs/java.html --%>

<%@ page import="info.magnolia.module.ModuleRegistry" %>
<%@ page import="com.nrgedge.magnolia.ReCaptchaModule" %>
<%@ page import="net.tanesha.recaptcha.ReCaptcha" %>
<%@ page import="net.tanesha.recaptcha.ReCaptchaImpl" %>
<%@ page import="net.tanesha.recaptcha.ReCaptchaFactory" %>

<cms:editBar editLabel="" />

<%
	ReCaptchaModule module = (ReCaptchaModule) ModuleRegistry.Factory.getInstance().getModuleInstance("recaptcha");

	ReCaptcha c = ReCaptchaFactory.newReCaptcha(module.getPublicKey(), module.getPrivateKey(), false);
	
	if (request.isSecure()) {
		((ReCaptchaImpl)c).setRecaptchaServer("https://www.google.com/recaptcha/api");
	}
	
	out.print(c.createRecaptchaHtml(null, null));
%>